package cn.itcalvin.sncoal.cth.pojo.common;

import cn.itcalvin.sncoal.cth.config.NullToStringSerializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @Classname RespUserInfo
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/6/18 12:20
 * @Created by CALVIN
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RespUserInfoEx {
    @ApiModelProperty(value = "用户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;


    @ApiModelProperty(value = "所属矿区矿井ID")
    @JsonSerialize(nullsUsing = NullToStringSerializer.class)
    private String belongName;

    @ApiModelProperty(value = "所属矿区矿井ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long belongId;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value="用户姓名")
    private String userName;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value="登录账号")
    private String loginName;

    /**
     * 角色类型
     */
    @ApiModelProperty(value="登录角色 1.股份 2.专家 3.矿区 4.矿井")
    private Integer roleType;
    private String roleTypeName;
    public String getRoleTypeName(){
        switch (roleType){
            case 1:
                return "陕西煤业";
            case 2:
                return "专家";
            case 3:
                return "矿业公司";
            case 4:
                return "矿井";
            default:
                return "未知";
        }
    }


    @ApiModelProperty(value="评分密码")
    @JsonSerialize(nullsUsing = NullToStringSerializer.class)
    private String mineCheckPassword;

    @ApiModelProperty(value="是否是管理员")
    private Boolean isManager;

}
